<%--
  Created by IntelliJ IDEA.
  User: TYZ
  Date: 2020/3/12
  Time: 19:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        function fileInit(){
            $('#myFile').fileinput({
                language: 'zh',
                uploadUrl: '<%=path%>/file/upLoadFile',
                maxFileCount :3, // 最多同时传送几个图片，需要加multiple注解
                enctype : 'multipart/form-data',
                maxFileSize : 1024, //单位为kb
                allowedFileExtensions : ['jpg', 'gif', 'png'],
                browseClass: 'btn btn-primary'
            });

            $('#myFile').on('fileuploaded',function(event, data, previewId, index){
                $("#fileName").val(data.response.imgUrl);
            })
        }

        $(function(){
            fileInit();
        })
    </script>
</head>
<body>
<div class="container-fluid">
    <div class="panel panel-primary" style="width:250px">
        <div class="panel-heading">
            <center><h1>增加</h1></center>
        </div>
        <div class="panel-body">
            <form id="registerForm">
                <div class="form-group">
                    <label for="name">请输入账号:</label>
                    <input type="text" class="form-control" name="username" id="name" placeholder="请输入账号">
                    <div id="tips"></div>
                </div>
                <div class="form-group">
                    <label for="upassword">请输入密码:</label>
                    <input type="password" class="form-control" name="upassword" id="upassword" placeholder="请输入密码">
                    <div id="tips"></div>
                </div>
                <div class="form-group">
                    <label for="lastname" class="col-sm-2 control-label">头像</label>
                    <div class="col-sm-10">
                        <input type="hidden" name="uimg" id="fileName">
                        <input type="file" id="myFile" name="myFile" multiple>multiple支持多个文件上传
                    </div>
                </div>
                <div class="form-group">
                    <label for="ubirthday">请输入生日:</label>
                    <input type="date" class="form-control" name="ubirthday" id="ubirthday" placeholder="请输入生日">
                    <div id="tips"></div>
                </div>
                <div class="form-group">
                    <label for="usex">请输入性别:</label>
                    <input type="radio" name="usex" value="1">男
                    <input type="radio" name="usex" value="2">女
                    <div id="tips"></div>
                </div>
                <div class="form-group">
                    <label for="roleIds">角色:</label>
                    <c:forEach items="${roles }" var="role">
                        <input type="checkbox" value="${role.roleId }" name="roleIds" id="roleIds"> ${role.roleName }
                    </c:forEach>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
